<template>
  <div>
    <el-card>
      <el-row :gutter="20">
        <el-col :span="3">
          <span style="font-size: 20px;">荣誉</span>
        </el-col>
        <el-col :span="3" offset="13">
          <el-button type="primary">新增</el-button>
        </el-col>
      </el-row>
      <el-row style="height: 450px">
        <el-table
          :data="honorData"
          border
          style="width: 100%"
          stripe="true"
        >
          <el-table-column
            prop="name"
            label="获奖/技能名称"
            width="180">
          </el-table-column>
          <el-table-column
            prop="time"
            label="获奖时间"
            width="180">
          </el-table-column>
          <el-table-column
            prop="status"
            label="状态">
          </el-table-column>
          <el-table-column label="删除">
            <template slot-scope="scope">
              <el-button type="primary" icon="el-icon-delete" @click="del(scope.$index)"></el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-row>
      <el-row>
        <div class="block">
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage4"
            :page-sizes="[6, 6, 6, 6]"
            :page-size="6"
            layout="total, sizes, prev, pager, next, jumper"
            :total="24">
          </el-pagination>
        </div>
      </el-row>
    </el-card>
  </div>
</template>

<script>
export default {
  data () {
    return {
      honorData: [
        {
          name: 'acm',
          time: '2020.2.2',
          status: '等待审核'
        },
        {
          name: '蓝桥杯',
          time: '2020.2.3',
          status: '等待审核'
        },
        {
          name: '数学建模',
          time: '2020.2.4',
          status: '审核通过'
        }
      ],
      currentPage1: 5,
      currentPage2: 5,
      currentPage3: 5,
      currentPage4: 4
    }
  },
  methods: {
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
      },
      del(x) {
        this.honorData.splice(x,1);
        this.$message({
          type: "success",
          message: "删除员工信息成功",
        });
      }
    }
}
</script>

<style lang="less" scoped>
.el-card {
  width: 50%;
  height: 70%;
  display: inline-block;
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
}
.block {
  position: absolute;
  justify-content: right;
}
</style>